KFbxReader Class Reference

#include <kfbxreader.h>

List of all members.


Detailed Description

Base class of other readers used internally.

This class provides the interfaces for reading files.

The role of the reader is to effectively "read" specific file data vs the role of the importer is to select a specific reader and launch the reading of a file through that reader.

See also:
KFbxImporter
ex:

A SDK user should - normally - not use this class, except if a custom reader must be created for plug-in extension, then KFbxReader must be the base class for the new custom reader in that particular situation.

Definition at line 86 of file kfbxreader.h.


Public Types

enum   EError {
   eFILE_CORRUPTED,
   eFILE_VERSION_NOT_SUPPORTED_YET,
   eFILE_VERSION_NOT_SUPPORTED_ANYMORE,
   eFILE_NOT_OPENED,
   eFILE_NOT_CREATED,
   eWRONG_PASSWORD,
   eINVALID_DOCUMENT_HANDLE,
   eDOCUMENT_NOT_SUPPORTED,
   eUNRESOLVED_EXTERNAL_REFERENCES,
   eUNIDENTIFIED_ERROR,
   eERROR_COUNT
}
  Error identifiers. More...
enum   KInfoRequest {
   eInfoExtension,
   eInfoDescriptions,
   eReserved1 = 0xFBFB
}
 
  • eInfoExtension // to get the file ext for a reader ex: "FBX"
    • eInfoDescriptions // to get the file description for a reader ex: "Autodesk FBX (*.fbx)"
    • eReserved1
More...
enum   EFileOpenSpecialFlags {
   ParseForGlobalSettings = 1,
   ParseForStatistics = 2
}
 
  • ParseForGlobalSettings // used for reading the Global settings section when an importer is initialized
    • ParseForStatistics // used for reading a group of statistics when an importer is initialized
More...
typedef KFbxReader *(*  CreateFuncType )(KFbxSdkManager &pManager, KFbxImporter &pImporter, int pSubID, int pPluginID)
typedef void(*  IOSettingsFillerFuncType )(KFbxIOSettings &pIOS)
typedef void *(*  GetInfoFuncType )(KInfoRequest pRequest, int pReaderTypeId)

Public Member Functions

  KFbxReader (KFbxSdkManager &pManager, int pID)
  Constructor.
virtual  ~KFbxReader ()
  Destructor.
virtual void  GetVersion (int &pMajor, int &pMinor, int &pRevision)
  Returns the file version.
virtual bool  FileOpen (char *pFileName)=0
  Opens the file with default flag.
virtual bool  FileOpen (KFile *pFile)
  Opens the file with KFile handle.
virtual bool  FileClose ()=0
  Closes the file stream.
virtual bool  IsFileOpen ()=0
  Checks if the file stream is open.
virtual bool  GetReadOptions (bool pParseFileAsNeeded=true)=0
  Returns file stream options.
virtual bool  Read (KFbxDocument *pDocument)=0
  Reads file with stream options.
virtual void  PluginReadParameters (KFbxObject &pParams)
  Reads extension plug-ins name, version and parameters, so that we can remember if a plug-in was used during export.
virtual bool  FileOpen (char *pFileName, EFileOpenSpecialFlags pFlags)
  Opens the file with specific EFileOpenSpecialFlags.
virtual bool  GetAxisInfo (KFbxAxisSystem *pAxisSystem, KFbxSystemUnit *pSystemUnits)
  Returns the system axis information and file system units from the file.
virtual bool  GetStatistics (KFbxStatistics *pStats)
  Returns statistics from the file.
virtual KFbxDocumentInfo GetSceneInfo ()
  Returns the scene info from the file.
virtual KArrayTemplate
< KFbxTakeInfo * > * 
GetTakeInfo ()
  Returns the list of take infos from the file.
virtual bool  GetDefaultRenderResolution (KString &pCamName, KString &pResolutionMode, double &pW, double &pH)
  If default camera resolution is OK, returns information about the resolution of the render.
bool  IsGenuine ()
  Judges if the format of the file is was created by an Autodesk plug-in.
KError GetError ()
  Retrieves error objects.
EError  GetLastErrorID () const
  Returns the ID of the last error that occurred when the file was read.
const char *  GetLastErrorString () const
  Returns the error string that describes the last error that occurred when the file was read.
void  GetMessage (KString &pMessage) const
  Returns a warning message that describes what occurred when the file was read.
KString GetMessage ()
  Returns a warning message that describes what occurred when the file was read.
void  ClearMessage ()
  Clears the warning message string.
virtual KFbxIOSettings GetIOSettings ()
  Access to a IOSettings object.
virtual void  SetIOSettings (KFbxIOSettings *pIOSettings)
  Set the IOSettings pointer to be used for this reader instance.
virtual void  SetProgressHandler (KFbxProgress *pProgress)
  Pass a progress handler to the reader.

Protected Member Functions

void  SetDefaultRenderResolution (const char *pCamName, const char *pResolutionMode, double pW, double pH)
void  PluginsReadBegin (KFbxScene &pScene)
void  PluginsRead (const char *pName, const char *pVersion)
void  PluginsReadEnd (KFbxScene &pScene)
KFbxReader operator= (KFbxReader const &)
virtual bool  CheckDuplicateNodeNames (KFbxNode *pRootNode, KString &pDuplicateNodeNameList)

Protected Attributes

KFbxSdkManager mManager
KDefaultRenderResolution mData

Friends

struct  KFbxReaderFbx7Impl

Member Typedef Documentation

typedef KFbxReader*(* CreateFuncType)(KFbxSdkManager &pManager, KFbxImporter &pImporter, int pSubID, int pPluginID)

typedef void(* IOSettingsFillerFuncType)(KFbxIOSettings &pIOS)

typedef void*(* GetInfoFuncType)(KInfoRequest pRequest, int pReaderTypeId)

Member Enumeration Documentation

enum EError

Error identifiers.

  • eFILE_CORRUPTED
  • eFILE_VERSION_NOT_SUPPORTED_YET
  • eFILE_VERSION_NOT_SUPPORTED_ANYMORE
  • eFILE_NOT_OPENED
  • eFILE_NOT_CREATED
  • eWRONG_PASSWORD
  • eINVALID_DOCUMENT_HANDLE
  • eDOCUMENT_NOT_SUPPORTED
  • eUNRESOLVED_EXTERNAL_REFERENCES
  • eUNIDENTIFIED_ERROR
  • eERROR_COUNT
Enumerator:
eFILE_CORRUPTED 
eFILE_VERSION_NOT_SUPPORTED_YET 
eFILE_VERSION_NOT_SUPPORTED_ANYMORE 
eFILE_NOT_OPENED 
eFILE_NOT_CREATED 
eWRONG_PASSWORD 
eINVALID_DOCUMENT_HANDLE 
eDOCUMENT_NOT_SUPPORTED 
eUNRESOLVED_EXTERNAL_REFERENCES 
eUNIDENTIFIED_ERROR 
eERROR_COUNT 

Definition at line 112 of file kfbxreader.h.

  • eInfoExtension // to get the file ext for a reader ex: "FBX"
    • eInfoDescriptions // to get the file description for a reader ex: "Autodesk FBX (*.fbx)"
    • eReserved1
Remarks:
Used internally to get reader file information.
Enumerator:
eInfoExtension 
eInfoDescriptions 
eReserved1 

Definition at line 133 of file kfbxreader.h.

  • ParseForGlobalSettings // used for reading the Global settings section when an importer is initialized
    • ParseForStatistics // used for reading a group of statistics when an importer is initialized
Remarks:
Used internally when an importer is initialized to get some information very fast
Enumerator:
ParseForGlobalSettings 
ParseForStatistics 

Definition at line 144 of file kfbxreader.h.


Constructor & Destructor Documentation

KFbxReader ( KFbxSdkManager pManager,
int  pID  
)

Constructor.

Parameters:
pManager  The KFbxSdkManager Object
pID  Id for current reader

virtual ~KFbxReader (  )  [virtual]

Destructor.


Member Function Documentation

virtual void GetVersion ( int pMajor,
int pMinor,
int pRevision  
) [inline, virtual]

Returns the file version.

Parameters:
pMajor  Major version
pMinor  Minor version
pRevision  Revision version

Definition at line 163 of file kfbxreader.h.

virtual bool FileOpen ( char *  pFileName  )  [pure virtual]

Opens the file with default flag.

Parameters:
pFileName  Name of the File to open
Returns:
If the file opens successfully return true, otherwise return false.

virtual bool FileOpen ( KFile *  pFile  )  [virtual]

Opens the file with KFile handle.

Parameters:
pFile  The KFile handle
Returns:
If the file opens successfully return true, otherwise return false.

virtual bool FileClose (  )  [pure virtual]

Closes the file stream.

Returns:
false

virtual bool IsFileOpen (  )  [pure virtual]

Checks if the file stream is open.

Returns:
false.

virtual bool GetReadOptions ( bool  pParseFileAsNeeded = true  )  [pure virtual]

Returns file stream options.

Parameters:
pParseFileAsNeeded  Sets whether to parse file as read options
Returns:
true on success, otherwise return false.

virtual bool Read ( KFbxDocument pDocument  )  [pure virtual]

Reads file with stream options.

Parameters:
pDocument  KFbxDocument to store the file data
Returns:
false.

virtual void PluginReadParameters ( KFbxObject pParams  )  [virtual]

Reads extension plug-ins name, version and parameters, so that we can remember if a plug-in was used during export.

This is especially useful for extension plug-ins that modify the scene and also to warn users during import if an extension plug-in was used that could be missing.

Parameters:
pParams  The parameters of the extension plug-in. The properties of the objects are used as the parameters of the extension plug-in.
Remarks:
This function has no implementation in this class. Only sub-class should implement it as needed. For example, FBX 6 and FBX 7 does implement it.

virtual bool FileOpen ( char *  pFileName,
EFileOpenSpecialFlags  pFlags  
) [inline, virtual]

Opens the file with specific EFileOpenSpecialFlags.

Parameters:
pFileName  Name of the File to open.
pFlags  The EFileOpenSpecialFlags to open with
Returns:
If the file opens successfully return true, otherwise return false.

Definition at line 214 of file kfbxreader.h.

virtual bool GetAxisInfo ( KFbxAxisSystem pAxisSystem,
KFbxSystemUnit pSystemUnits  
) [inline, virtual]

Returns the system axis information and file system units from the file.

Parameters:
pAxisSystem  Axis system in file
pSystemUnits  System unit in file
Returns:
false.

Definition at line 221 of file kfbxreader.h.

virtual bool GetStatistics ( KFbxStatistics pStats  )  [inline, virtual]

Returns statistics from the file.

Parameters:
pStats  Statistics in the file.
Returns:
false.

Definition at line 227 of file kfbxreader.h.

virtual KFbxDocumentInfo* GetSceneInfo (  )  [inline, virtual]

Returns the scene info from the file.

Returns:
NULL.

Definition at line 232 of file kfbxreader.h.

References NULL.

virtual KArrayTemplate<KFbxTakeInfo*>* GetTakeInfo (  )  [inline, virtual]

Returns the list of take infos from the file.

Returns:
NULL

Definition at line 237 of file kfbxreader.h.

References NULL.

virtual bool GetDefaultRenderResolution ( KString pCamName,
KString pResolutionMode,
double pW,
double pH  
) [virtual]

If default camera resolution is OK, returns information about the resolution of the render.

Parameters:
pCamName  Default camera name.
pResolutionMode  Default resolution mode.
pW  Default resolution width.
pH  Default resolution height.
Returns:
true If default camera resolution is OK, false Otherwise.

bool IsGenuine (  ) 

Judges if the format of the file is was created by an Autodesk plug-in.

An internal (genuine) plug-in is one created by the Autodesk FBX product team.

Returns:
true If the file format is internal plug-in , false Otherwise.

KError& GetError (  ) 

Retrieves error objects.

Returns:
Reference to error objects.

EError GetLastErrorID (  )  const

Returns the ID of the last error that occurred when the file was read.

Returns:
Last error ID.

const char* GetLastErrorString (  )  const

Returns the error string that describes the last error that occurred when the file was read.

Returns:
A text description of the last error.

void GetMessage ( KString pMessage  )  const

Returns a warning message that describes what occurred when the file was read.

Parameters:
pMessage  The returned warning message.

KString& GetMessage (  ) 

Returns a warning message that describes what occurred when the file was read.

Returns:
The warning message.

void ClearMessage (  ) 

Clears the warning message string.

virtual KFbxIOSettings* GetIOSettings (  )  [virtual]

Access to a IOSettings object.

Returns:
A pointer to IOSettings used for this reader or NULL if the object has not been allocated.

virtual void SetIOSettings ( KFbxIOSettings pIOSettings  )  [virtual]

Set the IOSettings pointer to be used for this reader instance.

Parameters:
pIOSettings 

virtual void SetProgressHandler ( KFbxProgress pProgress  )  [inline, virtual]

Pass a progress handler to the reader.

Parameters:
pProgress  KFbxProgress to store the progress information.

Definition at line 297 of file kfbxreader.h.

void SetDefaultRenderResolution ( const char *  pCamName,
const char *  pResolutionMode,
double  pW,
double  pH  
) [protected]

void PluginsReadBegin ( KFbxScene pScene  )  [protected]

void PluginsRead ( const char *  pName,
const char *  pVersion  
) [protected]

void PluginsReadEnd ( KFbxScene pScene  )  [protected]

KFbxReader& operator= ( KFbxReader const &   )  [inline, protected]

Definition at line 306 of file kfbxreader.h.

virtual bool CheckDuplicateNodeNames ( KFbxNode pRootNode,
KString pDuplicateNodeNameList  
) [protected, virtual]

Friends And Related Function Documentation

friend struct KFbxReaderFbx7Impl [friend]

Definition at line 318 of file kfbxreader.h.


Member Data Documentation

KFbxSdkManager& mManager [protected]

Definition at line 309 of file kfbxreader.h.

Definition at line 310 of file kfbxreader.h.

KFbxReader KFbxReader KFbxReader KFbxReader KFbxReader KFbxReader KFbxReader KFbxReader KFbxReader KFbxReader
KFbxReader KFbxReader KFbxReader KFbxReader KFbxReader KFbxReader KFbxReader KFbxReader KFbxReader KFbxReader